﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOAModels;
using TarreOA.TarreOABLL;

public partial class admin_UserInfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            if (Request.QueryString["back"]=="1")
            {
                btnClose.Text = "返回";
                btnClose.PostBackUrl = "UserInfoRight.aspx";
            }
            else
            {
                btnClose.Text = "关闭";
                btnClose.OnClientClick = "window.close();return false;";
            }
            TarreOA.TarreOAModels.User user = UserManager.FindByLoginName(Request.QueryString["loginName"]);
            lblLoginNameValue.Text = user.LoginName;
            lblUserNameValue.Text = user.UserName;
            if (user.UserInfo.Sex)
            {
                lblSexValue.Text = "男";
            }
            else
            {
                lblSexValue.Text = "女";
            }
            if(user.UserInfo.AcademicCertificate==1)
            {
                lblAcademicCertificateValue.Text = "本科";
            }
            else if (user.UserInfo.AcademicCertificate == 2)
            {
                lblAcademicCertificateValue.Text = "大专";
            }
            else
            {
                lblAcademicCertificateValue.Text = "中专";
            }
            lblIDCardValue.Text = user.UserInfo.IDCard;
            lblNationValue.Text = user.UserInfo.Nation.NationName;
            lblAddressValue.Text = user.UserInfo.Address;
            lblTelephoneValue.Text = user.UserInfo.Telephone;
            lblSectionValue.Text = user.Section.SectionName;
            lblFinishShoolTimeValue.Text = user.UserInfo.FinishShoolTime.ToShortDateString();
            lblFinishShoolValue.Text = user.UserInfo.FinishShool;
            lblJoinTimeValue.Text = user.UserInfo.JoinTime.ToShortDateString();
            lblMobValue.Text = user.UserInfo.Mob;
            lblEmailValue.Text = user.UserInfo.Email;
        }
    }
}
